{include file="common/head"/}
<div class="admin-main layui-anim layui-anim-upbit">
    <form class="layui-form layui-form-pane" lay-filter="form">
        <div class="layui-form-item">
            <label class="layui-form-label">分类名称</label>
            <div class="layui-input-4">
                <input type="text" name="title" lay-verify="required" placeholder="{:lang('pleaseEnter')}分类名称" class="layui-input" value="">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">审核周期</label>
            <div class="layui-input-block">
                <select name="cycle_id" lay-filter="cycle_id">

                    {volist name="cycle_list" id="vo"}
                    <option value="{$vo.id}" {$vo.id==$section_data.cycle_id?'select':''}>{$vo.title}</option>
                    {/volist}

                </select>
            </div>
        </div>
        <div class="layui-form-item">
            <div class="layui-input-block">
                <input type="hidden" name="cate_id">
                <button type="button" class="layui-btn" lay-submit="" lay-filter="submit">{:lang('submit')}</button>
            </div>
        </div>
    </form>
</div>
{include file="common/foot"/}
<script>
    layui.use(['form', 'layer'], function () {
        var form = layui.form,layer = layui.layer,$= layui.jquery;
        var info = {$info|raw};
        form.val("form", info);
        form.render();
        form.on('submit(submit)', function (data) {
            // 提交到方法 默认为本身
            $.post("{:url('cateEdit')}",data.field,function(res){
                if(res.code > 0){
                    layer.msg(res.msg,{time:1000,icon:1},function(){
                        parent.location.href = res.url;
                    });
                }else{
                    layer.msg(res.msg,{time:1000,icon:2});
                }
            });
        })
    });
</script>